const express = require('express');
const router = express.Router();
const hotelController = require('../controllers/hotelController');
const { authMiddleware } = require('../middleware/authMiddleware');

// 获取酒店房间列表
router.get('/stores/:storeId/rooms', hotelController.getRooms);

// 获取酒店房间详情
router.get('/rooms/:roomId', hotelController.getRoomDetail);

// 检查房间可用性
router.get('/rooms/:roomId/availability', hotelController.checkRoomAvailability);

// 创建房间预订（需要登录）
router.post('/rooms/:roomId/bookings', authMiddleware, hotelController.createBooking);

// 获取用户的预订列表（需要登录）
router.get('/user/bookings', authMiddleware, hotelController.getUserBookings);

// 获取店铺的预订列表（需要登录，且为店铺所有者）
router.get('/stores/:storeId/bookings', authMiddleware, hotelController.getStoreBookings);

// 更新预订状态（需要登录）
router.put('/bookings/:bookingId/status', authMiddleware, hotelController.updateBookingStatus);

module.exports = router; 